import com.alibaba.fastjson.JSON;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by fengtingxin on 2020/3/6.
 */
public class RequestMessage {




    private String data;
    private String sign;
    private String type;
    private String reqid;
    private String system;

    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }

    public String getSign() {
        return sign;
    }

    public void setSign(String sign) {
        this.sign = sign;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getReqid() {
        return reqid;
    }

    public void setReqid(String reqid) {
        this.reqid = reqid;
    }

    public String getSystem() {
        return system;
    }

    public void setSystem(String system) {
        this.system = system;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("RequestMessage{");
        sb.append("data='").append(data).append('\'');
        sb.append(", sign='").append(sign).append('\'');
        sb.append(", type='").append(type).append('\'');
        sb.append(", reqid='").append(reqid).append('\'');
        sb.append(", system='").append(system).append('\'');
        sb.append('}');
        return sb.toString();
    }

//    private RequestMessage setRequestParam(String venderId) throws Exception {
//        //拼装参数
//        String reqId = new SimpleDateFormat("yyyymmddhhMMss").format(new Date());
//        Map<String, String> data = new HashMap<String, String>();
//        data.put("alais", "V".concat(venderId));
////        data.put("alais","22318136001"); //测试环境使用
//        Map<String, Object> dataWraper = new HashMap<String, Object>();
//        dataWraper.put("serviceParam", data);
//        StringBuilder keyStr = new StringBuilder().append(reqId).append(KEY_REQKEY).append(KEY_SYSTEM_SYMBOL);
//        GsonBuilder gsonBuilder = new GsonBuilder().setDateFormat(DateUtils.YYYYMMDD_HHMMSS);
//        String dataJson = DES.encrypt(gsonBuilder.create().toJson(dataWraper), Base64Utils.encode(keyStr.toString().getBytes()), "UTF-8");
//
//        RequestMessage requestMessage = new RequestMessage();
//        requestMessage.setReqid(reqId);
//        requestMessage.setData(dataJson);
//        requestMessage.setSystem(KEY_SYSTEM_SYMBOL);
//        requestMessage.setType(KEY_REQ_TYPE);
//        requestMessage.setSign(MD5.md5(dataJson, keyStr.toString()));
//        logger.error("SplitSettleRpcImpl --> setRequestParam is requestMessage :{}", JSON.toJSONString(requestMessage));
//        return requestMessage;
//    }

    public static void main(String[] args) {

    }
}
